package TouristManagement;

/**
 * Interface definition : TouristManagementBO
 * 
 * @author OpenORB Compiler
 */
public class _TouristManagementBOStub extends org.omg.CORBA.portable.ObjectImpl
        implements TouristManagementBO
{
    static final String[] _ids_list =
    {
        "IDL:TouristManagement/TouristManagementBO:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = TouristManagement.TouristManagementBOOperations.class;

    /**
     * Operation createTourist
     */
    public short createTourist(String nomTourist, TouristManagement.DateV dateDeb, TouristManagement.DateV dateFin)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("createTourist",true);
                    _output.write_string(nomTourist);
                    TouristManagement.DateVHelper.write(_output,dateDeb);
                    TouristManagement.DateVHelper.write(_output,dateFin);
                    _input = this._invoke(_output);
                    short _arg_ret = _input.read_short();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("createTourist",_opsClass);
                if (_so == null)
                   continue;
                TouristManagement.TouristManagementBOOperations _self = (TouristManagement.TouristManagementBOOperations) _so.servant;
                try
                {
                    return _self.createTourist( nomTourist,  dateDeb,  dateFin);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
